<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<c:set var="url" value="${pageContext.request.contextPath}/" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div id="portId" style="width: 100%;height: 300px"></div>
</body>
<script src="${url }js/echarts.min.js"></script>
<script src="${url }js/anly_chart.js"></script>
<script type="text/javascript">
var chartName = "${chartPort.chartname}";
// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('portId'));

	var charttype = "${chartPort.charttype}"
	if(charttype == 1){
		var xdata = eval("("+"${chartPort.xdata}"+")");
		var ydata = eval("("+"${chartPort.ydata}"+")");
		
		zhuzhuang(chartName,xdata,ydata); 
		myChart.setOption(zhu_option);
	}else if(charttype == 2){
		var dataname = [''];
		var xdata = eval("("+"${chartPort.xdata}"+")");
		var ydata = eval("("+"${chartPort.ydata}"+")");
		zhexian(chartName,dataname,xdata,ydata);
		myChart.setOption(zhexian_option);
	}else if(charttype == 3){
		var bing_dataAxis = [''];
		var bing_data = eval("("+"${chartPort.piedata}"+")");
		bingtu(chartName,bing_dataAxis,bing_data);
		myChart.setOption(bing_option);
	}else{
		var dataAll = new Array();
		dataAll[0] = eval("("+"${chartPort.scatterdata}"+")");
		sandian(chartName,dataAll);
	   myChart.setOption(sandian_option);
	}
</script>
</html>